package vip.xiaonuo.smzq.modular.psba.controller;

import javax.annotation.Resource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import vip.xiaonuo.smzq.modular.psba.entity.PsbaSqjlJbqk;
import vip.xiaonuo.smzq.modular.psba.entity.vo.PsbaSqjlFyfVo;
import vip.xiaonuo.smzq.modular.psba.entity.vo.PsbaSqjlVo;
import vip.xiaonuo.smzq.modular.psba.entity.vo.Fyfxxtb;
import vip.xiaonuo.smzq.modular.psba.service.IPsbaSqjlJbqkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import vip.xiaonuo.common.pojo.CommonResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


/**
 * 评审备案申请记录-非压覆基本情况
 *
 * @author Kevin
 * @since 2024-06-11
 */
@Api(tags = "评审备案申请记录-非压覆基本情况")
@RestController
@RequestMapping("/psba/psbaSqjlJbqk")
@Validated
public class PsbaSqjlJbqkController {

    @Resource
    private IPsbaSqjlJbqkService iPsbaSqjlJbqkService;

    /**
     * 添加评审备案申请记录-非压覆基本情况
     */
    @ApiOperation("添加评审备案申请记录-非压覆基本情况")
    @PostMapping("/add")
    public CommonResult<String> add(@RequestBody @Valid PsbaSqjlFyfVo psbaSqjlFyfVo) {
//        iPsbaSqjlJbqkService.add(psbaSqjlFyfVo);
        return CommonResult.ok();
    }

    /**
     * 删除评审备案申请记录-非压覆基本情况
     */
    @ApiOperation("删除评审备案申请记录-非压覆基本情况")
    @PostMapping("/delete")
    public CommonResult<String> delete(@ApiParam(name = "pkid", value = "主键") @RequestParam String pkid) {
        iPsbaSqjlJbqkService.removeById(pkid);
        return CommonResult.ok();
    }

    /**
     * 编辑评审备案申请记录-非压覆基本情况
     */
    @ApiOperation("编辑评审备案申请记录-非压覆基本情况")
    @PostMapping("/edit")
    public CommonResult<String> edit(@RequestBody @Valid PsbaSqjlJbqk psbaSqjlJbqk) {
        iPsbaSqjlJbqkService.updateById(psbaSqjlJbqk);
        return CommonResult.ok();
    }

    /**
     * 评审备案申请记录-非压覆基本情况分页查询
     */
    @ApiOperation("评审备案申请记录-非压覆基本情况分页查询")
    @GetMapping("/list")
    public CommonResult<Page<PsbaSqjlJbqk>> page() {
        return CommonResult.data(iPsbaSqjlJbqkService.page(new PsbaSqjlJbqk()));
    }
    /**
     * 评审备案申请记录-非压覆评审备案申请详情
     */
    @ApiOperation("评审备案申请记录-非压覆评审备案申请详情")
    @GetMapping("/getFyfxxtb")
    public CommonResult<Fyfxxtb> getFyfxxtb( @ApiParam(name = "psbabh", value = "评审备案编号") @RequestParam String psbabh) {

        return CommonResult.data(iPsbaSqjlJbqkService.getFyfxxtb(psbabh));
    }
}
